const userDao = require("../dao/userDao");

module.exports = {
    //注册
    async register(username, pwd) {
        let result=await userDao.QueryName(username);
        if(result){
            return({code:'0',msg:'账号已注册'}) 
        }else{
            await userDao.RegisteredUsers(username, pwd);
            return ({code:'1',msg:'账号可注册'})
        }
    },
    async login(username, pwd) {
        return await userDao.QueryUser(username, pwd);
    }
}